package com.iqiyi.pps.epg.core.model.program;

/**
 * Created by karkarrotxu on 2017/3/22.
 */
public class DirectorEditAssist {
    private boolean change = false;

    private String originalSign;

    public DirectorEditAssist(ProgramDirector data) {
        originalSign = accountSign(data);
    }

    public void checkAgain(ProgramDirector programDirector) {
        String newSign = accountSign(programDirector);
        change = !originalSign.equals(newSign);
    }

    public String accountSign(ProgramDirector programDirector) {
        String sign = programDirector.getProgramName() + "|" +
                programDirector.getOutputStreamType() + "|" +
                programDirector.getOutputUrl() + "|" +
                programDirector.getStartPlayTime().getTime() + "|" +
                programDirector.getStopPlayTime().getTime() + "|" +
                programDirector.getDelay();
        return sign;
    }

    public boolean isChange() {
        return change;
    }
}
